package think_oberver;

import java.util.Observable;

public class Frame extends Observable{
	String name;

	public Frame(String name) {
		this.name = name;
	}

	public void setName(String name) {
		this.name = name;
		this.setChanged();
		this.notifyObservers();
	}
	
	public String getName(){
		return name;
	}
	
	
	
	public static void main(String[] args) {
		
		Observer one=new Observer("one");
		Observer two=new Observer("two");
		
		Frame f=new Frame("test");
		f.addObserver(one);
		f.addObserver(two);
		f.setName("yang");
		
	}

}
